//
//  HLUserDetailHeaderView.m
//  YueYue
//
//  Created by hulu001 on 2023/5/18.
//

#import "HLUserDetailHeaderView.h"
#import "HLUserDetailInfoView.h"
#import "HLUserDetailTagView.h"

@interface HLUserDetailHeaderView ()

@property (nonatomic, strong) HLUserDetailInfoView *infoView;
@property (nonatomic, strong) HLUserDetailTagView *tagView;

@end

@implementation HLUserDetailHeaderView


- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = UIColorWhite;
        self.contentView.backgroundColor = UIColorWhite;
        [self setupView];
    }
    return self;
}


- (void)setupView
{
    self.infoView = [[HLUserDetailInfoView alloc] init];
    [self.contentView addSubview:_infoView];
    [_infoView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.mas_equalTo(0);
    }];
    
    self.tagView = [[HLUserDetailTagView alloc] init];
    [self.contentView addSubview:_tagView];
    [_tagView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.mas_equalTo(0);
        make.top.equalTo(_infoView.mas_bottom);
    }];
}


+ (NSString *)identifyCell
{
    return NSStringFromClass([self class]);
}

- (void)setModel:(HLUserInfoModel *)model
{
    _model = model;
    
    _infoView.model = model;
    _tagView.tags = [model.tagVOS qmui_mapWithBlock:^NSString * _Nonnull(HLHomeTagModel * _Nonnull item, NSInteger index) {
        return item.tagName;
    }];
    _tagView.signLabel.text = model.selfSign;
}

@end
